<?php

class Homepage extends MX_Controller {
	function Homepage()
	{
		parent::__construct();
		$this->load->helper('url');
		$this->load->model('public_model');
		$this->load->library('CommonUtils');	
		$this->load->model('homepage_model');
	}
	
	function index()
	{
		$data=array();
		$data['homepage']=1;
		
//		if(!empty($seller_id))
//		{
//			if(isAccessFromMobile())
//				$content=modules::run('productlist/hotitem',$seller_id);
//			else
//				$content=modules::run('productlist/hotitem',$seller_id).modules::run('productlist/newproduct',$seller_id);
//		}
		$data = array();
		$data['all_deals'] = modules::run('deal/all_deals');
		if(isAccessFromMobile()){
			$this->load->view('mobile/homepage_view', $data,false);
		}
		else
		{
			$this->load->view('homepage_view', $data,false);
		}		
	}	
    function recentdeal()
    {
        $data = array();
		$data['all_deals'] = modules::run('deal/all_deals',null,null,true);
		if(isAccessFromMobile()){
			$this->load->view('mobile/homepage_view', $data,false);
		}
		else
		{
			$content = $this->load->view('homepage_view', $data,true);
            Template::display($content);
		}		
    }
}



?>